﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace H3Cheater
{
    public class THero    //英雄属性
    {

        public static byte HClass;    //英雄类别
        public static byte Level;    //英雄等级
        public static byte TreeN;    //技能随机数
        public static byte LastWisdom =0;    //上一次智慧术等级
        public static byte Wisdom =0;
        public static byte LastMagic =0;    //上一次魔法技能等级
        public static byte Magic = 0;
        public static byte Attack;             //进攻
        public static byte Defense;          //防御
        public static byte SpellPower;      //力量
        public static byte Knowledge;     //知识
        public static bool Skill8 = false;  //是否学满8技能；
        public static byte[] SkillLv = new byte[28];  //英雄已学技能对应等级，范围0-27，赋值大小1-3；
        public static byte SkillLeft = 255;     //左侧技能槽技能
        public static byte LeftLv = 0;
        public static byte SkillRight =255;   //右侧技能槽技能
        public static byte RightLv = 0;
        public static uint Seed;      //种子，由随机数决定
        public static uint Sec1;      //因子1，决定四维指数，这里我们不考虑四维
        public static uint Sec2;      //因子2，决定已有技能
        public static uint Sec3;      //因子3，决定新学技能
        public enum SkillName
{
            PATHFINDING, ARCHERY, LOGISTICS, SCOUTING, DIPLOMACY, NAVIGATION, LEADERSHIP,
            WISDOM, MYSTICISM, LUCK, BALLISTICS, EAGLE_EYE, NECROMANCY, ESTATES,
            FIRE_MAGIC, AIR_MAGIC, WATER_MAGIC, EARTH_MAGIC, SCHOLAR, TACTICS, ARTILLERY,
            LEARNING, OFFENSE, ARMORER, INTELLIGENCE, SORCERY, RESISTANCE, FIRST_AID, NONE
        };
 


        public void HeroStart()   //英雄初始化，从窗口得到数据；
        {
            uint Pri;
            Seed = (uint)(0x343FD * Level + 0x26497 * TreeN + 0x259DF);
            Sec1 = 0X343FD * Seed + 0X269ec3;
            Sec2 = 0X343FD * Sec1 + 0X269ec3;
            Sec3 = 0X343FD * Sec2 + 0X269ec3;
            Pri = (Sec1 / 0X10000) & 0X7FFF;
            Level = (byte)(Level + 1);

            //这个模块用于存放英雄数据，读取第一次基础数据，后面的数据循环解决；
            //skill模块用于显示每一次升级后的技能，这里还得有个确定了学习技能后的动作；学习同时录入技能id和技能lv；
            //设想放窗口按钮事件里
            //意向技能保存到英雄的技能槽，左右技能槽赋值255代表没有技能，然后进入下一次循环；

        }

    }

}

